﻿namespace SW.Lite.Infrastructure.Exception
{
    /// <summary>
    ///     带错误编码的异常
    /// </summary>
    public class CodeException : System.Exception
    {
        /// <summary>
        ///     带错误编码的异常
        /// </summary>
        /// <param name="errorCode">错误编码</param>
        /// <param name="message">错误信息</param>
        /// <param name="innerException">内部错误</param>
        public CodeException(int errorCode, string message = "", System.Exception innerException = null)
            : base(message, innerException)
        {
            ErrorCode = errorCode;
        }

        /// <summary>
        ///     错误编码
        /// </summary>
        public int ErrorCode { get; set; }
    }
}